#ifndef CONFIG_H
#define CONFIG_H

#include <string>

using namespace std;

class Config
{
  private:

    static Config *s_instance;

    Config();
    ~Config(); 
    Config(const Config &);             // intentionally undefined
    Config & operator=(const Config &); // intentionally undefined
    
    void split(string line, string& name, string& value, string seperator);
    string removeWhitespaces(string line);
  public:

    //singleton
    void initialize();
    void initialize(string fileName);

    static Config *getInstance();
    int i;
    int j;
    bool useGivenBoundariesWhenPossible;
    
    string databaseFilename;
    string imagesTrainPathname;
    string wordsTrainPathname;
    string imagesTestPathname;
    string wordsTestPathname;
    string wordsOutputPathname;
    
    double lineSeperationDeviationWeightFactor;
    double lineSeperationWhitePixelWeight;
    double lineSeperationBlackPixelWeight;
    
    int wordSeperationHypotheseMinimumGapWidth;
    int wordSeperationHypotheseThresholdWidth;
    bool wordSeperationOnlyLookBetweenBaseAndXLine;
    bool wordSeperationUseShearedImage;
    int thresholddistance;  // 50 * 50
    int threshold;
    int minimumConnectedComponentSize; 
 
    int bottomProfileSampleNumber; //the number of samples taken when making the bottom profile

// radontransform
    int radonanglecount;  // 32;
    int radonlinecount;   // 32;
    int radonhistowidth;  // 32;
    
//featureDistance
    bool applyWeightsBeforeSquaring;

    int maxWordLengthDifference;
    double wordLengthDifferenceWeight;
    double radonDistanceWeight;
    double bottomProfileDistanceWeight;
    double heightWidthRatioWeight;
    double lowResolutionWordDistanceWeight;
    int maxGap; //the maximal gap accepted between words when constructing an optimal line of the recognized word hypotheses
     
     
    int lowResolutionWordWidth;
    int lowResolutionWordHeight;
  //TODO: read and write xml config-files
};
#endif
